package com.kun.index.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 消息通知表
 * </p>
 *
 * @author kunkun
 * @since 2024-03-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("message")
@ApiModel(value="Message对象", description="消息通知表")
public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "消息id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "消息通知内容")
    private String content;

    @ApiModelProperty(value = "消息通知类型")
    private String type;

    @ApiModelProperty(value = "看用户是否查看,默认为1,方便红点显示和消失")
    private Integer isNew;

    @ApiModelProperty(value = "与type对应的内容id（如果是评论的话就是评论id，如果类型是系统的话，就是系统id）")
    private Integer typeId;

    @ApiModelProperty(value = "所属人id")
    private Integer userId;

    @ApiModelProperty(value = "通知者id")
    private Integer byUserId;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;

    @ApiModelProperty(value = "逻辑删除（1：已删除，0：未删除）")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "通知者的头像url")
    @TableField(exist=false)
    private String byUserAvatarUrl;
    @ApiModelProperty(value = "通知者的昵称")
    @TableField(exist=false)
    private String byUserNickname;
    @ApiModelProperty(value = "通知者的身份")
    @TableField(exist=false)
    private String byUserRole;
    @ApiModelProperty(value = "消息通知来源内容,评论-评论内容,博客-博客标题")
    @TableField(exist=false)
    private String typeContent;


}
